package com.qf.day08.homework.book;

public class Book {

    private static int idCount = 0;

    // book对象的唯一标识
    private int bookId;

    private String bookName;

    private String bookAuthor;

    private String location;

    public Book() {
        this.bookId = idCount++;  // 处理每个book对象的id自增
    }

    public Book(String bookName, String bookAuthor, String location) {
        this.bookId = idCount++;
        this.bookName = bookName;
        this.bookAuthor = bookAuthor;
        this.location = location;
    }

    public int getBookId() {
        return bookId;
    }

    public void setBookId(int bookId) {
        this.bookId = bookId;
    }

    public String getBookName() {
        return bookName;
    }

    public void setBookName(String bookName) {
        this.bookName = bookName;
    }

    public String getBookAuthor() {
        return bookAuthor;
    }

    public void setBookAuthor(String bookAuthor) {
        this.bookAuthor = bookAuthor;
    }

    public String getLocation() {
        return location;
    }

    public void setLocation(String location) {
        this.location = location;
    }

    @Override
    public String toString() {
        return "Book{" +
                "bookId=" + bookId +
                ", bookName='" + bookName + '\'' +
                ", bookAuthor='" + bookAuthor + '\'' +
                ", location='" + location + '\'' +
                '}';
    }
}
